<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>Portable Social Networks for Django</title>
    </head>
<body>
<h2>django_psn - Portable Social Networks for Django</h2>

<p>
Leah Culver (leahculver.com)
</p>

<p>
Please send feedback to leah@megatechtronium.com
</p>

<p>
Django-PSN provides users of a social website to provide and display information about their
 other online social networks. The project was created to let Pownce users 
 show their friends what other online social networks they participate in. This data can
 also be used to connect friends across online social networks, building a free social graph.
</p>

<h3>Dependencies:</h3>
    <ul>
        <li>Django 0.96 (might need to make adjustments for Django development version)</li>
        <li>Django Auth Module, place 'django.contrib.auth' in INSTALLED_APPS setting</li>
    </ul>
    
<h3>To use django_psn:</h3>
    <ol>
        <li>Make django_psn available in your python path</li>
        <li>Add 'django_psn' to your INSTALLED_APPS setting</li>
        <li>To create the necessary database tables, run the command: manage.py syncdb</li>
    </ol>

<h3>To use the sample views:</h3>
<p>Add the following to your urlconf:</p>
    <pre>
    (r'^social_networks/$', 'django_psn.views.social_networks'),
    (r'^settings/social_networks/$', 'django_psn.views.settings_social_networks'),</pre>
<p>For sample templates add the path to django_psn/templates to your TEMPLATE_DIRS setting.</p>
    
<h3>About the models:</h3>

    <p>There are two chunks of information considered interesting to social network portability:</p>
    <ol>
        <li>Edges In and Edges Out - These define "friend" relationships between users.</li>
        <li>Claimed and Verified URLs - Assertions of a user's identity in other social networks.</li>
    </ol>
    <p>Edges In and Out is application specific but fairly easy data to obtain for a site owner.</p>
    
    <p>Identity URL assertions can be obtained through a GUI which can be mutually interesting to
    users and interesting to data collectors. Daniel Burka (Pownce designer) and I spent a lot of time thinking of how to gather these
    assertions from users. We decided that while online identities take one form to a data collector
    (a profile URL), users perceive online identity in three forms:
    </p>
    <ol>
        <li>Social Networks (online social site profiles)</li>
        <li>Instant Messengers (screenname)</li>
        <li>Websites (can be used for other types of online profiles such as weblogs or OpenID providers)</li>
    </ol>
    <p>We really wanted Pownce users to get immediate positive feedback for providing Pownce with their online identities.
    Pownce users are not only contributing to social graph data, but are also displaying links
    and profile data on their application profiles for their friends.</p>
    
<h3>Generate elsewhere_info JSON:</h3>
    
    <p>Add the following to your urlconf:</p>
    <pre>
    (r'^interface/elsewhere_info/$', 'django_psn.views.elsewhere_info'),</pre>
    
    <p>Customize the elsewhere_info view in django_psn/views.py. Specifically, you will need to
    generate lists of edges in and edges out based on how your application handles friend relationships.
    </p>

<h4>Expected Request for elsewhere_info</h4>
<pre>
Given a numeric node id or node identifier, return JSON about the
user, optionally with all related edges.

GET /interface/elsewhere_info?id=234234     # unique userid
GET /interface/elsewhere_info?ident=brad    # unique identifier (username / group name)
Host: www.elsewhere-cooperating-site.com

 arguments:
   id=           # integer nodeid to query.  this or 'ident' is required.
   ident=        # string identifier to query.  this or 'id' is required.
   want_edges=1  # optional: explicitly request/don't request edges_{in,out} (default whatever you want)
</pre>

<h4>Expected Response for elsewhere_info</h4>
<pre>
HTTP 200 OK
Content-Type: text/json      # server isn't picky; can be whatever

{
"node_id": 239847283947,
"node_ident": "brad",
"node_type": {"person"|"group"|"openid"},
"mbox_sha1sum": "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15",  # of "mailto:email@foo.com", ONLY IF email is verified

"claimed_urls": [
 "mbox_sha1sum:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15", # if not verified.
 "http://facebook.com/profile?id=23423434",
 "aim:bradfitzpatrick",
 "http://bradfitz.com/",
],

"verified_urls": [   # ONLY if proven with OpenID / facebook auth, etc...
 "http://facebook.com/profile?id=23423434",
}

"edges_out" : [  # all edges out, whether dest nodes are people _or_ groups.
  1,
  2,
  5,
  10,
],
"edges_in":[   # all edges out, whether source nodes are people _or_ groups.
  8,
],
};
</pre>
    
<h3>Other resources:</h3>
<ul>
    <li><a href="http://bradfitz.com/social-graph-problem/">Thoughts on the Social Graph</a> - Brad Fitzpatrick and David Recordon</li>
    <li><a href="http://microformats.org/wiki/social-network-portability">Microformats Social Network Portability</a> - from the Microformats wiki</li>
    <li><a href="http://www.brianoberkirch.com/2007/08/08/building-blocks-for-portable-social-networks/">Building Blocks for Portable Social Networks</a> - Brian Oberkirch</li>
    <li><a href="http://www.personalinfocloud.com/2006/11/following_frien.html">Following Friends Across Walled Gardens</a> - Thomas Vander Wal</li>
    <li><a href="http://www.plaxo.com/info/opensocialgraph">Open Social Graph @ Plaxo</a> - identity consolidation tools</li>
</ul>

</body>
</html>